Rolling Updating Log

文件类

目录相关

$ tree

作用:输出目录树层结构

输出目录树 n 层

1
$ tree -L n

输出目录树到文件

1
$ tree -L 2 >README.md //然后我们看下当前目录下的 README.md 文件

只显示文件夹

1
$ tree -d -L n

显示时忽略某些文件夹或文件 (Ignore)

1
$ tree -I "models"

系统设置类

关闭系统动画效果

关闭 MissionControl 动画

-float 后面是动画时间

1
defaults write com.apple.dock expose-animation-duration -float 0.0;killall Dock

关闭窗口和对话框动画

需要注销重新登录生效, 关闭:

1
defaults write -g NSAutomaticWindowAnimationEnabled -bool FALSE

打开:

1
defaults delete -g NSAutomaticWindowAnimationEnabled

关闭预览动画

关闭:

1
defaults write com.apple.finder QLPanelAnimationDuration -int 0;killall Finder

打开:

1
defaults delete com.apple.finder QLPanelAnimationDuration;killall Finder

关闭文件保存/打印的动画

需要注销后重新登录,关闭:

1
defaults write -g NSWindowResizeTime -float 0.01

打开:

1
defaults delete -g NSWindowResizeTime

关闭 LaunchPad 动画

关闭:

1
defaults write com.apple.dock springboard-show-duration -int 0 defaults write com.apple.dock springboard-hide-duration -int 0;killall Dock

打开:

1
defaults delete com.apple.dock springboard-show-duration defaults delete com.apple.dock springboard-hide-duration;killall Dock

关闭 Dock 栏动画

关闭:

1
defaults write com.apple.dock autohide-time-moidifier -int 0;killall Dock

打开:

1
defaults write com.apple.dock autohide-time-moidifier -int 0;killall Dock

设置 Dock 自动隐藏唤起的延迟

https://www.quora.com/How-can-I-completely-hide-or-remove-the-Dock-in-Mac-OS-X-Yosemite 说不建议将 Dock 彻底的关掉,因为 Dock 的运行服务和系统的桌面背景等相关功能有关, 更好的方式是将 Dock 设置为自动隐藏,唤起时间加长这样就不会轻易触发.

-float 5 是唤起的延迟时间

1
defaults write com.apple.Dock autohide-delay -float 5 && killall Dock

恢复默认的自动唤起:

1
defaults delete com.apple.Dock autohide-delay

限制进程的 CPU 使用率

https://apple.stackexchange.com/questions/24998/can-i-manually-limit-the-cpu-used-by-a-process
http://www.willnolan.com/cputhrottle/cputhrottle.html

参考

https://github.com/herrbischoff/awesome-macos-command-line
https://www.infoworld.com/article/2614879/mac-os-x/mac-os-x-top-20-os-x-command-line-secrets-for-power-users.html?page=6
https://developer.apple.com/library/content/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_cmds.html

Rolling Update

2018-05-14 09:47:59 Update: 增加设置 Dock 自动隐藏唤起时间设置
2018-05-13 20:09:32 Update: 增加关闭动画命令